In [1]:
from nltk.corpus.reader import TaggedCorpusReader
from nltk.tag import AffixTagger
import pickle

In [2]:
#trainer
reader = TaggedCorpusReader('.', 'greek_training_set.pos')
train_sents = reader.tagged_sents()

2-char suffix tagger


In [3]:
suffix_tagger = AffixTagger(train_sents, affix_length=-2)

In [4]:
suffix_tagger.evaluate(train_sents)


Out[4]:
0.20355849401464465

3-char suffix tagger


In [5]:
three_suffix_tagger = AffixTagger(train_sents, affix_length=-3)

In [6]:
three_suffix_tagger.evaluate(train_sents)


Out[6]:
0.2462203693883768

4-char suffix tagger


In [7]:
four_suffix_tagger = AffixTagger(train_sents, affix_length=-4)

In [8]:
four_suffix_tagger.evaluate(train_sents)


Out[8]:
0.23366014915437816

5-char suffix tagger


In [9]:
five_suffix_tagger = AffixTagger(train_sents, affix_length=-5)

In [10]:
five_suffix_tagger.evaluate(train_sents)


Out[10]:
0.18811560028431848

6-char suffix tagger


In [11]:
six_suffix_tagger = AffixTagger(train_sents, affix_length=-6)

In [12]:
six_suffix_tagger.evaluate(train_sents)


Out[12]:
0.1341543217537486